package psd.model.Prolog.Converters;

import org.eclipse.jdt.core.dom.IfStatement;

import psd.model.IConverter;
import psd.model.Prolog.FactGenerationToolbox;
import psd.model.Prolog.PrologConverter;


public class PrologIfStatementConverter extends PrologConverter implements
		IConverter<IfStatement> {

	public PrologIfStatementConverter(FactGenerationToolbox toolbox) {
		super(toolbox);
	}

	@Override
	public boolean convert(IfStatement node) {
		String args[] = { idResolver.getID(node.getExpression()),
				idResolver.getID(node.getThenStatement()),
				idResolver.getID(node.getElseStatement()),
				this.getFilePath(node), this.getLineNumber(node)};
		createBodyFact(node, "ifT", args);
		return true;
	}

}
